Optimal. Leaf size=168 \[ \frac {3 \tanh ^{-1}(\cos (c+d x))}{64 a^2 d}-\frac {2 \cot ^5(c+d x)}{5 a^2 d}-\frac {3 \cot ^7(c+d x)}{7 a^2 d}-\frac {\cot ^9(c+d x)}{9 a^2 d}+\frac {3 \cot (c+d x) \csc (c+d x)}{64 a^2 d}+\frac {\cot (c+d x) \csc ^3(c+d x)}{32 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x)}{8 a^2 d}+\frac {\cot ^3(c+d x) \csc ^5(c+d x)}{4 a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.26, antiderivative size = 168, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 8, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {2954, 2952,
2687, 14, 2691, 3853, 3855, 276} \begin {gather*} -\frac {\cot ^9(c+d x)}{9 a^2 d}-\frac {3 \cot ^7(c+d x)}{7 a^2 d}-\frac {2 \cot ^5(c+d x)}{5 a^2 d}+\frac {3 \tanh ^{-1}(\cos (c+d x))}{64 a^2 d}+\frac {\cot ^3(c+d x) \csc ^5(c+d x)}{4 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x)}{8 a^2 d}+\frac {\cot (c+d x) \csc ^3(c+d x)}{32 a^2 d}+\frac {3 \cot (c+d x) \csc (c+d x)}{64 a^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 276
Rule 2687
Rule 2691
Rule 2952
Rule 2954
Rule 3853
Rule 3855
Rubi steps
\begin {align*} \int \frac {\cot ^8(c+d x) \csc ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx &=\frac {\int \cot ^4(c+d x) \csc ^6(c+d x) (a-a \sin (c+d x))^2 \, dx}{a^4}\\ &=\frac {\int \left (a^2 \cot ^4(c+d x) \csc ^4(c+d x)-2 a^2 \cot ^4(c+d x) \csc ^5(c+d x)+a^2 \cot ^4(c+d x) \csc ^6(c+d x)\right ) \, dx}{a^4}\\ &=\frac {\int \cot ^4(c+d x) \csc ^4(c+d x) \, dx}{a^2}+\frac {\int \cot ^4(c+d x) \csc ^6(c+d x) \, dx}{a^2}-\frac {2 \int \cot ^4(c+d x) \csc ^5(c+d x) \, dx}{a^2}\\ &=\frac {\cot ^3(c+d x) \csc ^5(c+d x)}{4 a^2 d}+\frac {3 \int \cot ^2(c+d x) \csc ^5(c+d x) \, dx}{4 a^2}+\frac {\text {Subst}\left (\int x^4 \left (1+x^2\right ) \, dx,x,-\cot (c+d x)\right )}{a^2 d}+\frac {\text {Subst}\left (\int x^4 \left (1+x^2\right )^2 \, dx,x,-\cot (c+d x)\right )}{a^2 d}\\ &=-\frac {\cot (c+d x) \csc ^5(c+d x)}{8 a^2 d}+\frac {\cot ^3(c+d x) \csc ^5(c+d x)}{4 a^2 d}-\frac {\int \csc ^5(c+d x) \, dx}{8 a^2}+\frac {\text {Subst}\left (\int \left (x^4+x^6\right ) \, dx,x,-\cot (c+d x)\right )}{a^2 d}+\frac {\text {Subst}\left (\int \left (x^4+2 x^6+x^8\right ) \, dx,x,-\cot (c+d x)\right )}{a^2 d}\\ &=-\frac {2 \cot ^5(c+d x)}{5 a^2 d}-\frac {3 \cot ^7(c+d x)}{7 a^2 d}-\frac {\cot ^9(c+d x)}{9 a^2 d}+\frac {\cot (c+d x) \csc ^3(c+d x)}{32 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x)}{8 a^2 d}+\frac {\cot ^3(c+d x) \csc ^5(c+d x)}{4 a^2 d}-\frac {3 \int \csc ^3(c+d x) \, dx}{32 a^2}\\ &=-\frac {2 \cot ^5(c+d x)}{5 a^2 d}-\frac {3 \cot ^7(c+d x)}{7 a^2 d}-\frac {\cot ^9(c+d x)}{9 a^2 d}+\frac {3 \cot (c+d x) \csc (c+d x)}{64 a^2 d}+\frac {\cot (c+d x) \csc ^3(c+d x)}{32 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x)}{8 a^2 d}+\frac {\cot ^3(c+d x) \csc ^5(c+d x)}{4 a^2 d}-\frac {3 \int \csc (c+d x) \, dx}{64 a^2}\\ &=\frac {3 \tanh ^{-1}(\cos (c+d x))}{64 a^2 d}-\frac {2 \cot ^5(c+d x)}{5 a^2 d}-\frac {3 \cot ^7(c+d x)}{7 a^2 d}-\frac {\cot ^9(c+d x)}{9 a^2 d}+\frac {3 \cot (c+d x) \csc (c+d x)}{64 a^2 d}+\frac {\cot (c+d x) \csc ^3(c+d x)}{32 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x)}{8 a^2 d}+\frac {\cot ^3(c+d x) \csc ^5(c+d x)}{4 a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.25, size = 313, normalized size = 1.86 \begin {gather*} \frac {\csc ^9(c+d x) \left (-451584 \cos (c+d x)-155904 \cos (3 (c+d x))+20736 \cos (5 (c+d x))+14976 \cos (7 (c+d x))-1664 \cos (9 (c+d x))+119070 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)-119070 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)+212940 \sin (2 (c+d x))-79380 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))+79380 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))+195300 \sin (4 (c+d x))+34020 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (5 (c+d x))-34020 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (5 (c+d x))+16380 \sin (6 (c+d x))-8505 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (7 (c+d x))+8505 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (7 (c+d x))-1890 \sin (8 (c+d x))+945 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (9 (c+d x))-945 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (9 (c+d x))\right )}{5160960 a^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.43, size = 202, normalized size = 1.20
method | result | size |
derivativedivides | \(\frac {\frac {\left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{9}-\frac {\left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {5 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{7}-\frac {8 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+4 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {16 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+18 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{9 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}-\frac {18}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {1}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}+\frac {16}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-24 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {5}{7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}-\frac {4}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}+\frac {8}{5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}}{512 d \,a^{2}}\) | \(202\) |
default | \(\frac {\frac {\left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{9}-\frac {\left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {5 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{7}-\frac {8 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+4 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {16 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+18 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{9 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}-\frac {18}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {1}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}+\frac {16}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-24 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {5}{7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}-\frac {4}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}+\frac {8}{5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}}{512 d \,a^{2}}\) | \(202\) |
risch | \(-\frac {945 \,{\mathrm e}^{17 i \left (d x +c \right )}+19584 i {\mathrm e}^{4 i \left (d x +c \right )}-8190 \,{\mathrm e}^{15 i \left (d x +c \right )}+8064 i {\mathrm e}^{6 i \left (d x +c \right )}-97650 \,{\mathrm e}^{13 i \left (d x +c \right )}+147840 i {\mathrm e}^{12 i \left (d x +c \right )}-106470 \,{\mathrm e}^{11 i \left (d x +c \right )}-14976 i {\mathrm e}^{2 i \left (d x +c \right )}-40320 i {\mathrm e}^{14 i \left (d x +c \right )}+106470 \,{\mathrm e}^{7 i \left (d x +c \right )}+120960 i {\mathrm e}^{10 i \left (d x +c \right )}+97650 \,{\mathrm e}^{5 i \left (d x +c \right )}+330624 i {\mathrm e}^{8 i \left (d x +c \right )}+8190 \,{\mathrm e}^{3 i \left (d x +c \right )}+1664 i-945 \,{\mathrm e}^{i \left (d x +c \right )}}{10080 a^{2} d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{9}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{64 a^{2} d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{64 a^{2} d}\) | \(238\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 314 vs.
\(2 (152) = 304\).
time = 0.30, size = 314, normalized size = 1.87 \begin {gather*} \frac {\frac {\frac {11340 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3360 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {2520 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {1008 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {450 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} - \frac {315 \, \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} + \frac {70 \, \sin \left (d x + c\right )^{9}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{9}}}{a^{2}} - \frac {15120 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} + \frac {{\left (\frac {315 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {450 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {1008 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {2520 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {3360 \, \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} - \frac {11340 \, \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} - 70\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{9}}{a^{2} \sin \left (d x + c\right )^{9}}}{322560 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 269, normalized size = 1.60 \begin {gather*} -\frac {3328 \, \cos \left (d x + c\right )^{9} - 14976 \, \cos \left (d x + c\right )^{7} + 16128 \, \cos \left (d x + c\right )^{5} - 945 \, {\left (\cos \left (d x + c\right )^{8} - 4 \, \cos \left (d x + c\right )^{6} + 6 \, \cos \left (d x + c\right )^{4} - 4 \, \cos \left (d x + c\right )^{2} + 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 945 \, {\left (\cos \left (d x + c\right )^{8} - 4 \, \cos \left (d x + c\right )^{6} + 6 \, \cos \left (d x + c\right )^{4} - 4 \, \cos \left (d x + c\right )^{2} + 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 630 \, {\left (3 \, \cos \left (d x + c\right )^{7} - 11 \, \cos \left (d x + c\right )^{5} - 11 \, \cos \left (d x + c\right )^{3} + 3 \, \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{40320 \, {\left (a^{2} d \cos \left (d x + c\right )^{8} - 4 \, a^{2} d \cos \left (d x + c\right )^{6} + 6 \, a^{2} d \cos \left (d x + c\right )^{4} - 4 \, a^{2} d \cos \left (d x + c\right )^{2} + a^{2} d\right )} \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.53, size = 245, normalized size = 1.46 \begin {gather*} -\frac {\frac {15120 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{2}} - \frac {42774 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 11340 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 3360 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 2520 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 1008 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 450 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 315 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 70}{a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9}} - \frac {70 \, a^{16} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 315 \, a^{16} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 450 \, a^{16} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 1008 \, a^{16} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 2520 \, a^{16} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 3360 \, a^{16} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 11340 \, a^{16} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{18}}}{322560 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 12.56, size = 387, normalized size = 2.30 \begin {gather*} -\frac {70\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{18}-70\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{18}+315\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{17}-315\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{17}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-450\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}+1008\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}-2520\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{13}+3360\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-11340\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+11340\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-3360\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2520\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{13}\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-1008\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+450\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+15120\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{322560\,a^2\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________